import { axios } from '@/axios'

//测试接口地址
export const uploadApi = async (id, files) => {
    let formData = new FormData()
    for (let i = 0; i < files.length; i++) {
        let file = files[i]
        formData.append('files', new Blob([file.raw], { type: file.type }), file.name)//这里的fileData就是文件的二进制数据
    }
    let configs = {
        headers: { 'Content-Type': 'multipart/form-data' }
    }
    let url = `oss/upload/files/${id}`
    const res = await axios.post(url, formData, configs);
    return res
}